<template>

  <el-row :gutter="10">
    <el-col :span="24">
      <FormRoleTransfer :userId="params.id" v-model:value="roleData"></FormRoleTransfer>
    </el-col>
  </el-row>
</template>

<script lang="ts" setup>
// @ts-ignore
import {getCurrentInstance, ref, watch} from 'vue'
//定义组件名称
defineOptions({
  name: "UserGrant"
})

//接收的参数
const props = defineProps({
  params: {required: true, type: Object, default: {}}

});
// @ts-ignore
const {proxy} = getCurrentInstance()

// 表单 数据
let roleData = ref("")
watch(() => roleData.value, (newValue, oldValue) => {
  proxy.$http.post('/user-center/role/grantUser', {
    userId: props.params.id,
    roleIds: newValue
  }).then((response: any) => {
    console.log(response);
  });


})

</script>
